mybatis配置mapperLocations多个路径
<property name="mapperLocations"> <array> <value>classpath*:/mybatis-config.xml</value> <value>classpath*:/com/**/sqlmap-*.xml</value> </array> </property>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="mapperLocations"> <array> <value>classpath:mybatis/mapper/*.xml</value> <value>classpath:mybatis/mapper/database/*.xml</value> </array> </property> <property name="dataSource" ref="dataSource"/> <property name="configLocation" value="classpath:mybatis/config/mybatis-config.xml"/> </bean>
<property name="mapperLocations" > <list> <value>classpath*:/sqlmap/*.xml</value> <value>classpath*:/test/*.xml</value> </list> </property>